<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="tag" tagdir="/WEB-INF/tags" %>
<jsp:include page="xhtml-header.jsp"/>
<jsp:include page="header-tag.jsp">
	<jsp:param name="pagetitle" value="Create Project"/>
</jsp:include>
<div>
<fieldset>
<legend>Create A New Project</legend>
<form method="POST" action="socialsnp">
<input type="hidden" name="action" value="project.submit"/>
<c:if test="${not empty requestScope['project.id']}">
<input type="hidden" name="project.id" value="${requestScope['project.id']}"/>
</c:if>

<ul>
	<c:choose>
		<c:when test="${ empty requestScope['project.id']}">
			<li>
				<label for="project.name">Project Name</label>
				<input type="text" id="project.name" name="project.name"  onFocus="javascript:toggleMsg('msg.name')" onBlur="javascript:toggleMsg('msg.name')" maxlength="50"/>
				<span id="msg.name" class="msg" style="visibility:hidden;">Required. Must be unique</span>
			</li>
		</c:when>
		<c:otherwise>
			<li>
				<label for="project.name">Project Name</label>
				<input value="${requestScope['project.name']}" disabled="true" />
			</li>
		</c:otherwise>
	</c:choose>
	<li>
		<label for="project.desc">Project Description</label>
		<input type="text" id="project.desc" name="project.desc" value="${requestScope['project.desc']}" onFocus="javascript:toggleMsg('msg.desc')" onBlur="javascript:toggleMsg('msg.desc')" maxlength="50"/>
		<span id="msg.desc" class="msg" style="visibility:hidden;">Required</span>
	</li>
	<li>
		<label for="project.admins">Administrator(s)</label>
		<textarea rows="10" cols="60" id="project.admins" name="project.admins"  onFocus="javascript:toggleMsg('msg.admins')" onBlur="javascript:toggleMsg('msg.admins')"><c:out value="${requestScope['project.admins']}"/></textarea>
		<span id="msg.admins" class="msg" style="visibility:hidden;">Administrators</span>
	</li>
	<li>
		<label for="project.members">Members:</label>
		<textarea rows="10" cols="60" id="project.members" name="project.members"  onFocus="javascript:toggleMsg('msg.members')" onBlur="javascript:toggleMsg('msg.members')"><c:out value="${requestScope['project.members']}"/></textarea>
		<span id="msg.members" class="msg" style="visibility:hidden;">Members</span>
	</li>
	<li>
		<label for="project.scope">Scope:</label>
		<select selectedindex="${project.scope.index}" id="project.scope" name="project.scope" onFocus="javascript:toggleMsg('msg.members')" onBlur="javascript:toggleMsg('msg.members')">
			<option>PRIVATE</option>
			<option>PUBLIC</option>
		</select>
		<span id="scope" class="msg" style="visibility:hidden;">Scope public/private</span>
	</li>
	<li>
		<label for="project.submit">Submit:</label>
		<c:choose>
				<c:when test="${ empty requestScope['project.id']}">
					<input id="project.submit" type="submit" value="Create Project"/>
				</c:when>
				<c:otherwise>
					<input id="project.submit" type="submit" value="Update Project"/>
				</c:otherwise>
		</c:choose>
	</li>
</ul>
</form>
</fieldset>
</div>
<jsp:include page="xhtml-footer.jsp"/>

